function insertData() {
    var name = document.getElementById("name").value;
    var age = document.getElementById("age").value;
    $.ajax({
        type: "post",
        url: 'http://localhost:8088/addStudent',
        data: {
            name: name,
            age: age
        },
        dataType: "json",
        success: function () {
            alert("成功");
        }
    })
}
function insertM() {
    document.getElementById("insert").style.display = "none";
}
function selectM() {
    document.getElementById("select").style.display = "none";
}
function selectData() {
    var name2 = document.getElementById("name2").value;
    var select = document.getElementById("test");
    select.style.listStyle = "none";
    $.ajax({
        type: "post",
        url: 'http://localhost:8088/queryStudent',
        data: {
            name: name2
        },
        dataType: "json",
        success: function (msg) {
            for(var i = 0; i < msg.length; i++ )
                select.innerHTML = select.innerHTML + "<li>&nbsp;id:"+msg[i].id+"&nbsp;姓名："+msg[i].name+"&nbsp;年龄："+msg[i].age+"</li>";
        }
    })
}

function test() {
    alert("test");
    $.ajax({
        type: "post",
        url: 'http://localhost:8088/test',
        data: {
            name: ''
        },
        dataType: "json",
        success: function (msg) {
            console.log(msg + "123")
        },
        error: function (data) {
            alert("连接失败");
        }
    })
}

